<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <ul id="u1">
    <li><a href="" class="ws">qwe</a></li>
    <li><a href="" class="ws">qwe</a></li>
    <li><a href="" class="ws">qwe</a></li>
    <li><a href="" class="ws">qwe</a></li>
    <li><a href="">qwe</a></li>
  </ul>
  <ul id="u2">
    <li class="qer"><a href=""  class="ws">asd</a></li>
    <li class="qer"><a href=""  class="ws">asd</a></li>
    <li class="qer"><a href=""  class="ws">asd</a></li>
    <li class="qer"><a href=""  class="ws">asd</a></li>
    <li><a href="">asd</a></li>
  </ul>
  <script>
    //根据选择器获取元素
    var ar = document.querySelector("#u1 .ws");
    console.log(ar);
    var ars = document.querySelectorAll("#u1 .ws");
    console.log(ars);//NodeList
    var arss = document.querySelectorAll("#u2>.qer");
    console.log(arss);
  </script>
</body>
</html>